//
//  RHPlantModel.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/8/3.
//

#import "RHPlantModel.h"

@implementation RHPlantModel
- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
    return YES;
}
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
{
    return @{@"plant_id" : @"id"
             };
}

- (void)setPlantProductRelations:(NSArray *)plantProductRelations
{
    NSMutableArray *mtbArr = [NSMutableArray array];
    [plantProductRelations enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if(obj[@"productType"]){
            [mtbArr addObject:obj[@"productType"]];
        }
    }];
    _plantProductRelations = mtbArr.copy;
}
@end
